#pragma once

#include "Property/EditorPropertyViewModel.h"
#include "EditorComponentPropertyModel.h"
#include "Widgets/CheckBoxWidget.h"
#include "EditorComponentPropertyViewModel.m.h"

class RTexture2D;
class REditorReflectedPropertyViewModel;

RCLASS()
class REditorComponentPropertyViewModel : public REditorPropertyViewModel
{
    ROBJECT

public:
    virtual void BindModel(TSharedObjectPtr<REditorPropertyModel> InModel
        ,TSharedObjectPtr<REditorObjectPropertyAbilityViewModel> InAbilityViewModel) override;

    void ToggleExpand();
    TSharedObjectPtr<RTexture2D> GetExpandIcon() const;
    bool IsExpand() const;

    ECheckBoxWidgetState GetAutoBeginPlayState() const;
    void ToggleAutoBeginPlay();

    CString GetName() const;


    void RemoveComponent();

    TSharedObjectPtr<REditorReflectedPropertyViewModel> GetProperties() const;

protected:

    TWeakObjectPtr<REditorComponentPropertyModel> ComponentModel;

    TSharedObjectPtr<RTexture2D> ExpandedIcon;
    TSharedObjectPtr<RTexture2D> CollapsedIcon;

    TSharedObjectPtr<REditorReflectedPropertyViewModel> Properties;
};